<?php

//print_r($_POST);
 
// username and password sent from form 
$Orid=$_POST['id']; 
$uid=$_POST['uid'];
$number=$_POST['number'];

$scan_code=$_POST['scan_code'];
print_r($_POST);


    if(!isItemExist($scan_code)){
    	  header("location:../index.php?page=organization_stack&id=".$Orid."&stat=error&error=notExist");
		

    }else{
    	//...do add new item
    	if(addItem($Orid,$scan_code,$uid,$number)){
			
    	header("location:../index.php?page=organization_stack&stat=stacked&id=".$Orid);
			
    	}else{
    		    header("location:../index.php?page=organization_stack&id=".$Orid."&stat=error&error=badData");
			

			
    	}
    
    	//header("location:../index.php?page=stack&id=".$Orid."&error=checkfail");
		
    }


    


?>